<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">

<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
	<%@page import = "java.util.*,java.text.*"%>
	<link rel="stylesheet" type="text/css" href="../css/base.css" media="all" />
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var ajaxRequest;
function cekAjax() //fungsi untuk mengecek apakah browser mendukung AJAX atau tidak
{
try
{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer Browsers
try
{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
}

function dataView() //to catch id gaul and show it
{
cekAjax();
var codeGaul = document.getElementById("search").value; //catch id gaul
if(codeGaul=="")
	{
		alert("Isi dengan Gaul Code");
		document.getElementById("search").focus();
		return false ;
	}
	if (codeGaul.length<5||codeGaul.length>5)
    {
         alert("Pengisian nomor harus antara 5 karakter");
 		document.getElementById("search").focus();
         return false;
    }

	var isTNumber=codeGaul.substring(0,2);

    if(isTNumber != 'SA')
    {
        alert("Pengisian dimulai dengan nomor SA");
		document.getElementById("search").focus();
        return false;            
    }
if (codeGaul !='SAKKK') {
ajaxRequest.open("GET","http://bizring.biz/ajax/cek.jsp?id=" + codeGaul,true); 			
}
else
	{
	ajaxRequest.open("GET","http://bizring.biz/ajax/gaul_top10.jsp", true);
	}
//msend id gaul cek.jsp or gaul_top10.jsp
ajaxRequest.send(null);
ajaxRequest.onreadystatechange = function()
{
document.getElementById("gaul").innerHTML = ajaxRequest.responseText; //open cek.jsp or gaul_top10.jsp
}
}
//-->
</script>

<script type="text/javascript">

function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
} 
</script>
<script type="text/javascript">
window.onload = function() {
XMLDoc();
loadXMLDoc();
startCountDown(05, 1000, loadXMLDoc);
countstart(05,1000,XMLDoc);
}
function startCountDown(i, p, f) {
// store parameters
var pause = p;
var fn = f;
// make reference to div
var countDownObj = document.getElementById("coba2");

if (countDownObj == null) {
// error
alert("div not found, check your id");
// bail
return;
}
countDownObj.count = function(i) {
// write out count
countDownObj.innerHTML = i;
			if (i == 00) {
					// execute function
						fn();
						// stop
						return;
						}
setTimeout(function() {
// repeat
countDownObj.count(i - 1);
						},
pause
);
}
// set it going
countDownObj.count(i);
}
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("coba").innerHTML=xmlhttp.responseText;
	 setTimeout("display()",100) ;
    }
  }
xmlhttp.open("GET","http://bizring.biz/ajax/count_gaul.jsp",true);
xmlhttp.send();
startCountDown(05,1000,loadXMLDoc);
}
function countstart(i, p, f) {
// store parameters
var pause = p;
var fn = f;
// make reference to div
var countDownObj = document.getElementById("target2");

if (countDownObj == null) {
// error
alert("div not found, check your id");
// bail
return;
}
countDownObj.count = function(i) {
// write out count
countDownObj.innerHTML = i;
			if (i == 00) {
					// execute function
						fn();
						// stop
						return;
						}
setTimeout(function() {
// repeat
countDownObj.count(i - 1);
						},
pause
);
}
// set it going
countDownObj.count(i);
}
function XMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("target").innerHTML=xmlhttp.responseText;
	 setTimeout("display()",100) ;
    }
  }
xmlhttp.open("GET","http://bizring.biz/ajax/date_ctc.jsp",true);
xmlhttp.send();
countstart(05,1000,XMLDoc);

}

</script>



</head>

<body id="wrap">
<jsp:include page="../bizring_header1.jsp"/>
	<div id="container">
		<!-- left-->		
	    <h2 class="hidden">sub_menu</h2>
		<div id="left_part">
			<div id="left_menu">
				<ul>
					<p><img src="../images/gaul/left_title00.gif" alt="Customer Center" /></p>
					<li style="padding-top:2px;"><a href="information.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image23','','../images/gaul/left_menu01_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image23','','../images/gaul/left_menu01_on.gif',1),this.blur()"><img src="../images/gaul/left_menu01_off.gif" name="Image23" width="161" border="0" id="Image23" alt="Gaul Information" /></a></li>
					<li><a href="mygaul.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image22','','../images/gaul/left_menu02_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image22','','../images/gaul/left_menu02_on.gif',1),this.blur()"><img src="../images/gaul/left_menu02_off.gif" name="Image22" width="161" border="0" id="Image22" alt="My Gaul" /></a></li>
                    <li>
				    <a href="gaul_news.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','../images/gaul/left_menu03_on.gif',1)" onblur="MM_swapImgRestore()" onfocus="MM_swapImage('Image22','','../images/gaul/left_menu02_on.gif',1),this.blur()"><img src="../images/gaul/left_menu03_off.gif" name="Image8" width="161" border="0" id="Image8" /></a>              		 </li>
			  </ul>
		    </div>
		</div>

	    <h2 class="hidden">contacts</h2>
<div class="main_busi_top2">  &nbsp;   
<ul>
     <li class="date"> <div id = "target"></div>
     <span class="text_tit">Biz - Ring Gaul ; </span></li>
    <li class="money"><div id = "coba"></div>
      </li>
    </ul>
      </div>
<div id="body_part">
			<div id="body_con">
              <p>&nbsp;</p>
              <div class="ta_top"></div>
				<div class="ta_bg">
					<div class="bs_con">
					  <p class="text_tit">My member</p><br/>

					<span class="text_12">&nbsp;&nbsp;&nbsp;Peserta dapat memantau jumlah aktivasi yang dilakukan (ranking)</span><br/>
					<span class="text_12">&nbsp;&nbsp;&nbsp;Caranya :</span><br/>

					<p style="padding:0px 0 0 0px;">&nbsp;&nbsp;&nbsp;Masuk ke website www.bizring.biz </p>
					<p style="padding:0px 0 0 0px;">&nbsp;&nbsp;&nbsp;Klik Icon Bizring Gaul </p>
					<p style="padding:0px 0 0 0px;">&nbsp;&nbsp;&nbsp;Masukkan kode peserta mu di tempat yang disediakan </p>
					<p style="padding:0px 0 0 0px;">&nbsp;&nbsp;&nbsp;Jumlah Aktivasi yang masuk ke peserta akan muncul. </p>
					<br/>

				<!-- Cari Pemenang -->
				<br/>
				<div style="float:left;width:223px;height:33px;margin-left:20px;background-image:url(../images/customer/search_bg.gif);">
					<input type="text" name="search" id="search" value="No Peserta Anda" onkeypress="return disableEnterKey(event)" onfocus="this.value='';" size="30" class="form_search" maxlength="" title="" />
					<p class="search_ex">ex) SA123</p>
				</div>
				<div class="search_btn"><input type="image" src="../images/common/btn_cari.gif" alt="send" align="absmiddle" onclick="dataView();"></div>
				<br/><br/><br/>

						<p class="text_orange">
                        &nbsp;
                        &nbsp;
                        &nbsp;
                        <div id="gaul" class="text_orange" ></div>
						<br/><br/> 



<br/> 
<div class="text_12"> * Mohon Maaf, untuk sementara Layanan TOP 10 Gaul tidak ditampilkan sampai batas waktu yang ditentukan</div>
<% /*
					<p class="text_tit">Top 10 Gaul</p><br/>

<table style='width:357pt;margin-left:4.2pt;'>
 <tr style='height:16.5pt'>
  <td style='width:25.0pt;border:solid windowtext 1.0pt;background:#FDE9D9;padding:0 5pt 0 5pt'>
  <span style='font-size:11.0pt;color:black'>Seq</span>
  </td>
  <td style='width:150pt;border:solid windowtext 1.0pt;background:#FDE9D9;padding:0 5pt 0 5pt'>
  <p style = 'text-align:center;'><span style='font-size:11.0pt;color:black;'>No Peserta</span></p>
  </td>
  <td style='width:150pt;border:solid windowtext 1.0pt;background:#FDE9D9;padding:0 5pt 0 5pt'>
  <span style='font-size:11.0pt;color:black'>Downlink</span>
  </td>
 </tr>
 */%>
 <%
	/*String connectionUrl = "jdbc:sqlserver://bizring.biz:14333;databaseName=bizring";
	String userid = "sa";
	String passwd = "qlalf@sql";
	String codeGaul = request.getParameter("codeGaul"); 
	
	// Declare the JDBC objects.
	java.sql.Connection con = null;
	
	java.sql.Statement stmt = null;
	java.sql.Statement stmt2 = null;
	java.sql.Statement stmt3 = null;
	
	java.sql.ResultSet rs = null;
	java.sql.ResultSet rs2 = null;
	java.sql.ResultSet rs3 = null;
	
	String year = "";
	String PreviousMonth = "";
	String date = "";
	
	// Establish the connection.
	Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
	
	out.println("<br/></p>");*/
%>

<%
	/*try {
		String gaulCodeList =	"  select top 10 row_number() over (order by COUNT (cust_master.gaul_code) desc, 	" +
								"         gaul_member.gaul_code) as seq, gaul_member.gaul_code, gaul_member.name, 	" +
								"         COUNT (cust_master.gaul_code) as cnt										" +
								"    from gaul_member, cust_master                                                  " +
								"   where gaul_member.gaul_code = cust_master.gaul_code                             " +
								"   group by gaul_member.gaul_code, gaul_member.name                                " +
								"  having COUNT (cust_master.gaul_code) > 0                                         " +
								"   order by COUNT (cust_master.gaul_code) desc, gaul_member.gaul_code              " ;

		con = java.sql.DriverManager.getConnection(connectionUrl, userid, passwd);
		stmt = con.createStatement();
		rs = stmt.executeQuery(gaulCodeList);

		while (rs.next()) {
%>

<tr style='height:16.5pt'>
	<td style='border:solid windowtext 1.0pt;padding:0 5pt 0 5pt;'><%=rs.getString("seq")%></td>
	<td style='border:solid windowtext 1.0pt;padding:0 5pt 0 5pt;'><%=rs.getString("gaul_code")%></td>
	<td style='border:solid windowtext 1.0pt;padding:0 5pt 0 5pt;'><%=rs.getString("cnt")%></td>
</tr>

<%
		}
%>
<%

	} catch (java.sql.SQLException e) {
		e.printStackTrace();
	} finally {
		try {   
            if(stmt !=null) stmt.close();   
            if(con !=null) con.close();   
        } catch (java.sql.SQLException e) {   
            e.printStackTrace();
        }
	}
*/%>
<%/*</table>*/%>
<br/><br/>







						</p>
				  </div>					
			  </div>
				<div class="ta_bot"></div>
    </div>		
	  </div>
	</div>

</div>
<div id = "coba2" style="visibility:hidden;"></div>
<div id = "target2" style="visibility:hidden;"></div>
<jsp:include page="../bizring_footer1.jsp" />
</BODY>
</HTML>
	